package com.assistant.spring;

import com.assistant.api.response.UserSearchResp;
import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.ConfigurableApplicationContext;

import java.util.Optional;

public class TestApplicationContextInitializer implements ApplicationContextInitializer {
    @Override
    public void initialize(ConfigurableApplicationContext applicationContext) {
        System.out.println("[ApplicationContextInitializer]");
    }

    public static void main(String[] args) {
        UserSearchResp userSearchResp = null;
        String result = Optional.ofNullable(userSearchResp).map(item -> item.getAddressDto()).map(addressDto -> addressDto.getBuildingCode()).orElse("aaaa");
        System.out.println(result);
    }
}